<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCarsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cars', function (Blueprint $table) {
            $table->increments('p_id');
            $table->char('p_no');
            $table->integer('aid');
            $table->integer('cid');
            $table->integer('uid');
            $table->integer('p_brand');
            $table->integer('p_subbrand');
            $table->integer('p_subsubbrand');
            $table->char('p_name',30);
            $table->char('p_allname',50);
            $table->char('p_keyword',100);
            $table->char('p_color',10);
            $table->char('p_country',30);
            $table->char('p_transmission',10);
            $table->char('p_emission',10);
            $table->integer('p_year');
            $table->mediumText('p_details');
            $table->integer('p_model');
            $table->integer('p_addtime');
            $table->mediumText('p_pics');
            $table->char('p_mainpic',100);
            $table->integer('p_hits');
            $table->integer('p_month');
            $table->integer('issprecom');
            $table->char('p_gas',10);
            $table->integer('issell');
            $table->integer('listtime');
            $table->decimal('p_price',8,2);
            $table->decimal('p_kilometre',8,2);
            $table->char('p_keywords',100);
            $table->char('p_username',30);
            $table->char('p_tel',30);
            $table->integer('isrecom');
            $table->integer('ishot');
            $table->integer('isshow');

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('cars');
    }
}
